# echo '> 生成ca的crt'
# openssl x509 -req -extfile ca_intermediate.ext -extensions v3_intermediate_ca -days 365 -in ca1.csr -CA server.crt -CAkey server.key -out ca1.crt -sha256 -CAcreateserial

# echo '> 生成node的crt'
# openssl req -key ./node.key -new -x509 -days 365 -out ./node.crt

echo '> 生成node.key'
openssl genrsa -des3 -out node.key 2048
echo '> 生成不需要密码的node.key'
openssl rsa -in node.key -out node.key
echo '> 生成csr'
openssl req -new -key node.key -out node.csr
echo '> 生成crt'
openssl x509 -req -days 365 -in node.csr -CA ca.crt -CAkey server.key -CAcreateserial -out node.crt
echo '> 证书合并'
cat node.key node.crt > node.pem
